<clr-modal [(clrModalOpen)]="createAppOpened">
    <h3 class="modal-title">{{appTitle}}</h3>
  <div class="modal-body">
    <form #appForm="ngForm">
      <section class="form-block">
        <div class="form-group" style="padding-left: 135px;">
          <label for="app_name" class="col-md-3 form-group-label-override required">名称</label>
          <label for="app_name" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left form-control">
            <input class="form-control" type="text" id="app_name"  [(ngModel)]="app.name"
                   name="app_name" size="32"
                   required
                   placeholder="英文小写，中划线分隔"
                   [readonly]="actionType==1"
                   pattern="[a-z]([-a-z0-9]*[a-z0-9])?"
                   maxlength="32"
                   (keyup)='handleValidation()'>
            <span class="tooltip-content">
              项目名称不符合规范，验证规则[a-z]([-a-z0-9]*[a-z0-9])?
            </span>
          </label>
          <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
        </div>
        <div hidden class="form-group" style="padding-left: 135px;">
          <label for="app_metadata" class="col-md-3 form-group-label-override">元数据</label>
          <textarea id="app_metadata" [(ngModel)]="app.metaData"
                    name="app_metadata"
                    rows="3">
          </textarea>

        </div>
        <div class="form-group" style="padding-left: 135px;">
          <label for="app_description" class="col-md-3 form-group-label-override">描述</label>
          <textarea id="app_description" [(ngModel)]="app.description"
                    name="app_description"
                    rows="3">
          </textarea>

        </div>
        <div class="modal-footer">

          <button type="button" class="btn btn-outline" (click)="onCancel()">取消</button>
          <button type="button" class="btn btn-primary" [disabled]="!isValid" (click)="onSubmit()">提交</button>
        </div>
      </section>
    </form>
  </div>
</clr-modal>
